<?php
session_start();

include('path.php') ;
require_once( SOJ_ROOT.'/include/function/lib.php');

require_once('Pager.php');

$tpl = new my_smarty();
$tpl->assign( 'active' , 'ranklist' );

if ( !empty( $_SESSION['username'] ) ){
	$tpl->assign( 'username' , $_SESSION['username'] );	
}
$db = db_connect();
$ranklist_process = new ranklist_process( $db );
$ranklist_process->update_ranklist();
$ranklist = $ranklist_process->get_ranklist();

$params = array(
    		'itemData' => $ranklist,
    		'perPage' => 30,
    		'delta' => 8,             
    		'append' => true,
    		'clearIfVoid' => false,
    		'urlVar' => 'entrant',
    		'useSessions' => true,
    		'closeSession' => true,
    		'mode'  => 'Jumping',
	);
	
$pager = & Pager::factory($params);
$page_data = $pager->getPageData();
$links = $pager->getLinks();

$tpl->assign( 'ranklist' , $page_data );
$tpl->assign( 'links' , $links['all']  );

$tpl->display('ranklist.tpl');
